<?php

$lang_from_to = str_replace("<#1>", "1.1.2", $lang_update['update_from_to']);
$lang_from_to = str_replace("<#2>", "1.1.5", $lang_from_to);

if($_GET['step']=="2"){
	mysql_query("UPDATE {$db_prefix}settings SET max_version='$ver_name'");
	
	mysql_query("CREATE TABLE `{$db_prefix}gallery_images` (
		  `id` int(10) unsigned NOT NULL auto_increment,
		  `album` int(10) unsigned NOT NULL,
		  `image` varchar(150) NOT NULL,
		  `title` varchar(100) NOT NULL,
		  `description` text,
		  `user` int(10) unsigned NOT NULL,
		  `time` int(10) unsigned NOT NULL,
		  PRIMARY KEY  (`id`)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;");

	mysql_query("CREATE TABLE `{$db_prefix}gallery_images_comments` (
		  `id` int(10) unsigned NOT NULL auto_increment,
		  `image` int(10) unsigned NOT NULL,
		  `user` int(10) unsigned NOT NULL,
		  `comment` text NOT NULL,
		  `time` int(10) unsigned NOT NULL,
		  PRIMARY KEY  (`id`)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;");
		

	$array_table = array(
		"Gallery_images ".$lang_update['upd_done']."",
		"Gallery_images_comments ".$lang_update['upd_done']."",
		"Gallery_settings ".$lang_update['upd_done']."",
		"Settings ".$lang_update['upd_done']."",
		"Rss ".$lang_update['upd_done']."",
		"Seo ".$lang_update['upd_done'].""
	);
	
	$html_ok = "<form method='post' onsubmit='return check_license()' action='upgrade.php'>";
	$html_ok .= "<br /><br /><div style='font: 16px Arial; font-weight: bold;'>";
	$html_ok .= "<center><input type='submit' class='img-submit' value='".$lang['submit_ok']."'/></center>";
	$html_ok .= "</form>";
	
}else{
	echo "<form method='post' onsubmit='return check_license()' action='upgrade.php?step=2'>";
	echo "<br /><br /><br /><br /><div style='font: 16px Arial; font-weight: bold;'>";
	echo "<center>".$lang_from_to."</center></div><br /><br /><br /><br />";
	echo "<input type='hidden' name='ver_name' value='1.1.5'/><div>";
	echo "<center><input type='submit' class='img-submit' value='".$lang['submit_ok']."'/></center>";
	echo "</form>";
}
?>